<template>
	<view class="content">
		<view class="ipts">
			<view class="record">
				<view class="">
					<image src="/static/jilu.png" mode=""></image>
					<text>用户信息</text>
				</view>

			</view>
			<view class="" v-if="list.status != 3">
				<!-- 户号 -->
				<view class="info-item">
					<view class="info-item-left">
						<view class="dot"></view>
						<text>检查部门</text>
					</view>
					<input class="item-ipt" type="text" disabled v-model="list.inspect" placeholder="检查部门名称" />
				</view>
				
				<!-- 户主姓名 -->
				<view class="info-item">
					<view class="info-item-left">
						<view class="dot"></view>
						<text>检查人</text>
					</view>
					<input class="item-ipt" type="text" disabled v-model="list.inspect_people" placeholder="请输入检查人" />
				</view>
				
				<!-- 身份证号 -->
				<view class="info-item">
					<view class="info-item-left">
						<view class="dot"></view>
						<text>检查地点</text>
					</view>
					<input class="item-ipt" type="text" disabled v-model="list.inspect_place" placeholder="检查地点" />
				
				</view>
				
				<!-- 联系方式 -->
				<view class="info-item">
					<view class="info-item-left">
						<view class="dot"></view>
						<text>检查时间</text>
					</view>
					<input class="item-ipt" type="text" disabled v-model="list.inspect_time" placeholder="检查时间" />
				</view>
				<!-- 主要内容 -->
				<view class="info-item">
					<view class="info-item-left">
						<view class="dot"></view>
						<text>主要内容</text>
					</view>
					<input class="item-ipt" type="text" disabled v-model="list.content"  placeholder="主要内容" />
				</view>
				<!-- 检查事项 -->
				<view class="info-item">
					<view class="info-item-left">
						<view class="dot"></view>
						<text>检查事项</text>
					</view>
					<input class="item-ipt" type="text" disabled v-model="list.inspect_matter" placeholder="检查事项" />
				</view>
				<!-- 检查记录 -->
				<view class="info-item">
					<view class="info-item-left">
						<view class="dot"></view>
						<text>检查记录</text>
					</view>
					<input class="item-ipt" type="text" disabled v-model="list.inspect_record" placeholder="检查记录" />
				</view>
				<!-- 影像资料 -->
				<view class="info-item">
					<view class="info-item-left">
						<view class="dot"></view>
						<text>影像资料</text>
					</view>
					<view class="addform-items">
						<view class="" style="position: relative;" v-for="(i,index) in list.video_data_files">
							<image class="form-img" :src="i" :key="index" @tap="seeimg(index)"></image>
						</view>
					</view>
				</view>
				<!-- 检查结果 -->
				<view class="info-item">
					<view class="info-item-left">
						<view class="dot"></view>
						<text>检查结果</text>
					</view>
					<input class="item-ipt" type="text" disabled v-model="list.inspect_result" placeholder="结果" />
				</view>
				<!-- 处理意见 -->
				<view class="info-item">
					<view class="info-item-left">
						<view class="dot"></view>
						<text>处理意见</text>
					</view>
					<input class="item-ipt" type="text" disabled v-model="list.opinion" placeholder="意见" />
				</view>
				<!-- 完成期限 -->
				<view class="info-item">
					<view class="info-item-left">
						<view class="dot"></view>
						<text>完成期限</text>
					</view>
					<input class="item-ipt" type="text" disabled v-model="list.term_time" placeholder="完成期限" />
				</view>
				<view class="info-item">
					<view class="info-item-left">
						<view class="dot"></view>
						<text>电子签名</text>
					</view>
					<view class="addform-items">
						<view class="" style="position: relative;" v-if="list.sign">
							<image class="form-img" :src="list.sign" @tap="seek(list.sign)"></image>
						</view>
					</view>
				</view>
				
			</view>
			
			
		</view>
	</view>
</template>

<script>
	export default {
	
		data() {
			return {
				list: {
					inspect_time: '',
					term_time: '',
					inspect: '', //检查部门
					inspect_people: '', //检查人
					inspect_place: '', //检查地点
					content: '', //主要内容
					inspect_matter: '', //检查事项
					inspect_record: '', //检查记录
					inspect_result: '', //检查结果
					opinion: '', //处理意见
					video_data_files: [], //影像资料
					sign:'',   //电子签名
				}
			}
		},
		onShow() {
			
		},
		onLoad(e) {
			console.log('e',e);
			this.getDetails(e.id)
			
			wx.enableAlertBeforeUnload({
			    message: "是否返回上一页",
			   });
		},
		methods: {
			getDetails(id){
				var _this = this
				uni.request({
					url: _this.$url + 'staff.Inspect/details',
					method:'GET',
					data:{
						id:id
					},
					success: (res) => {
						if(res.data.code == 0){
							return _this.$showToast(res.data.msg)
						}
						 var imgdata= res.data.data.video_data_files
						imgdata.forEach((item,i) =>{
							console.log(item)
							console.log(this.$imgurl)
						    res.data.data.video_data_files[i] = this.$imgurl + item
						 })
						  
						_this.list = res.data.data
					}
				})
			},
			seeimg(index) {
				let arr = []
				for (let i = 0; i < this.list.video_data_files.length; i++) {
					arr.push(this.list.video_data_files[i])
				}
				uni.previewImage({
					urls: arr,
					current: index,
					loop: true
				})
			},
			seek(img){
				uni.previewImage({
					urls: [img]
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.history {
		margin-top: 18rpx;
		padding: 20rpx;
		background: #FFFFFF;
		display: flex;
		align-items: center;
		.historyicon{
			width: 33rpx;
			height: 32rpx;
		}
		.text{
			margin-left: 12rpx;
			font-size: 28rpx;
			font-family: Source Han Sans SC;
			font-weight: 500;
			color: #003690;
		}
	}
	.content {
		background: #F1F1F1;
		padding-bottom: 100rpx;

		.header {
			display: flex;
			justify-content: space-between;
			align-items: center;
			// padding: 30rpx 30rpx;
			background-color: #F1F1F1;

			.header-right {
				display: flex;
				align-items: center;
				font-size: 24rpx;
				color: #333;
				// margin-right: 20rpx;
				padding: 10rpx 30rpx;

				image {
					width: 32rpx;
					height: 32rpx;
					margin-right: 10rpx;
				}
			}
		}

		.header1 {
			display: flex;
			align-items: center;
			box-sizing: border-box;
			height: 80rpx;
			width: 100%;
			background-color: #003690;
			padding: 0 30rpx;

			.ipt-box {
				display: flex;
				justify-content: space-between;
				align-items: center;
				box-sizing: border-box;
				padding: 0 20rpx;
				width: 450rpx;
				height: 52rpx;
				background-color: #fff;
				border-radius: 24rpx;

				image {
					width: 32rpx;
					height: 32rpx;
				}
			}

			.header1-right {
				display: flex;
				align-items: center;
				font-size: 28rpx;
				color: #E2ECFB;
				flex: 1;
				justify-content: center;

				image {
					width: 36rpx;
					height: 36rpx;
				}
			}
		}

		.newstyle {
			background: #003690;
			color: #FFFFFF;
		}



		.btns {
			position: fixed;
			bottom: 0;
			display: flex;
			width: 100%;
			z-index: 333;

			.btn1 {
				width: 50%;
				height: 96rpx;
				line-height: 96rpx;
				text-align: center;
				font-size: 24rpx;
			}

			.consel {
				background-color: #e9e9e9;
				color: #777;
			}

			.save {
				background-color: #003690;
				color: #fff;
			}
		}

		.btn:active {
			background: rgba(0, 0, 0, 0.4);
		}

		.zhanwei {
			height: 250rpx;
		}

		.ipts {
			background-color: #fff;
			margin-bottom: 20rpx;

			.record {
				display: flex;
				align-items: center;
				justify-content: space-between;
				color: #003690;
				font-size: 32rpx;
				padding-top: 20rpx;

				.right {
					width: 394rpx;
					height: 52rpx;
					background: #F2F2F2;
					opacity: 1;
					border-radius: 50rpx;
				}

				image {
					width: 32rpx;
					height: 32rpx;
					margin: 0 20rpx 0 30rpx;
				}
			}


			.liaison {
				display: flex;
				align-items: center;
				justify-content: space-between;
				padding: 10rpx 30rpx;

				.left {
					display: flex;
					align-items: center;

					.shuxian {
						width: 8rpx;
						height: 28rpx;
						background: #003690;
						opacity: 1;
						border-radius: 200rpx;
						margin-right: 10rpx;
					}

					.name {
						font-size: 28rpx;
						font-family: Source Han Sans SC;
						font-weight: 500;
						color: #333333;
						margin-right: 10rpx;
					}

					.time {
						font-size: 24rpx;
						font-family: Source Han Sans SC;
						font-weight: 400;
						color: #777777;
					}
				}

				.right {
					display: flex;
					align-items: center;

					image {
						width: 32rpx;
						height: 32rpx;
						margin-right: 10rpx;
					}

					.phone {
						font-size: 24rpx;
						font-family: Source Han Sans SC;
						font-weight: 400;
						color: #555555;
					}
				}
			}
		}

		.info-item {
			box-sizing: border-box;
			display: flex;
			align-items: center;
			justify-content: space-between;
			// height: 72rpx;
			width: 100%;
			height: 100rpx;
			padding: 0rpx 32rpx;
			align-items: center;
			background-color: #fff;
			font-size: 24rpx;
			color: #333;
			border-bottom: 1rpx solid #DDDDDD;

			image {
				width: 32rpx;
				height: 32rpx;
			}

			input {
				flex: 1;
				text-align: right;
			}

			.dot {
				width: 8rpx;
				height: 8rpx;
				background-color: #003690;
				border-radius: 50%;
				margin-right: 10rpx;
			}

			.danger-img {
				position: relative;

				.updeletes {
					position: absolute;
					top: -20rpx;
					right: -20rpx;
					width: 40rpx;
					height: 40rpx;
					display: flex;
					align-items: center;
					justify-content: center;
					z-index: 88;

					image {
						width: 100%;
						height: 100%;
					}
				}
			}

			.danger-img-box {
				display: flex;

				.danger-img {
					width: 75rpx;
					height: 75rpx;
					// border: 2rpx dashed #eee;
					margin-right: 10rpx;

					image {
						width: 100%;
						height: 100%;
					}
				}
			}

			.danger-img-box2 {
				display: flex;

				.danger-img {
					width: 75rpx;
					height: 75rpx;
					// border: 2rpx dashed #eee;
					margin-right: 10rpx;

					image {
						width: 100%;
						height: 100%;
						opacity: 1;
					}
				}
			}

			.info-item-left {
				display: flex;
				align-items: center;
				font-size: 28rpx;
			}

			.addform-items {
				display: flex;
				align-items: center;

				.delet {
					position: absolute;
					top: -8rpx;
					right: 4rpx;
					width: 28rpx;
					height: 28rpx;
					z-index: 10;
				}

				.form-img {
					width: 60rpx;
					height: 60rpx;
					margin-right: 20rpx;
				}

				.add {
					width: 60rpx;
					height: 60rpx;
					border: 1rpx solid #DDDDDD;
					display: flex;
					align-items: center;
					justify-content: center;
				}
			}
		}

	}
	
	.btns {
		position: fixed;
		bottom: 0;
		display: flex;
		width: 100%;
		z-index: 333;
	
		.btn1 {
			width: 50%;
			height: 96rpx;
			line-height: 96rpx;
			text-align: center;
			font-size: 24rpx;
		}
	
		.consel {
			background-color: #e9e9e9;
			color: #777;
		}
	
		.save {
			background-color: #003690;
			color: #fff;
		}
	}
	
</style>
